home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 087 / tcomm.arc / LXM.DOC < prev    next >
Encoding:
Text File  |  1987-07-07  |  26.6 KB  |  793 lines

  1.  LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  2.  
  3.  
  4.  
  5.         1.0 INTRODUCING XMODEM
  6.  
  7.              During the glory days of CP/M, the computer industry was 
  8.              plagued with a plethora of diskette formats. Since there 
  9.              was no single standard around, particularly when the 5" 
  10.              format was introduced, data interchange between computers 
  11.              was difficult.
  12.  
  13.              Several manufacturers attempted to provide a solution by 
  14.              giving their users the ability to at least read multiple 
  15.              diskette formats. Rather than promoting a standard format, 
  16.              this approach encouraged manufacturers to adopt proprietary 
  17.              formats as a marketing tool. Partially as a response to 
  18.              this situation, and partially out of a need to provide data 
  19.              transmission capabilities, Ward Christiansen developed the 
  20.              original specification for the xmodem file transfer 
  21.              protocol.
  22.  
  23.              The xmodem protocol, elegant in its simplicity and 
  24.              effectiveness, has transcended the decline of CP/M-based 
  25.              systems, and the ascendancey of MS-DOS to become a de facto 
  26.              standard for data transfer between remote computers. This 
  27.              fact is true, even in the light of the near-universal 
  28.              acceptance of another de facto standard for diskette 
  29.              formats, as popularized by the IBM-PC family. With the 
  30.              advent of the new PS/2 with its incompatible micro-
  31.              diskettes, the xmodem protocol's place, at least for the 
  32.              forseeable future, seems assured.
  33.  
  34.  
  35.         2.0 PROTOCOL FUNDAMENTALS
  36.  
  37.         2.1 THE TRANSMISSION BLOCK
  38.  
  39.              The fundamental building block of xmodem is an 8-bit byte, 
  40.              no parity please, arranged into transmission blocks of 
  41.              exactly 132 characters, never more nor less. In one 
  42.              extension to xmodem, commonly called CRC-xmodem, the 
  43.              transmission blocks are exactly 133 characters. We will 
  44.              discuss this extension later.
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                Copyright (c) 1987 - Information Technology, Ltd.
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  68.  
  69.  
  70.              As you might guess, not only is the length of a transmission 
  71.              block fixed, but so too is the format. The xmodem block 
  72.              format looks like this:
  73.  
  74.                  <SOH> <REC> <~REC> <...128 Data Bytes...> <checksum>
  75.  
  76.              where:
  77.  
  78.                   SOH - 0x01 Signals the start of a block
  79.  
  80.                   REC - Is the sequential block number reduced modulo 256
  81.  
  82.                   ~REC - The ones-compliment of REC
  83.  
  84.                   checksum - an 8-bit sum of the preceeding 128 data 
  85.                        bytes, formed by adding each byte to an 
  86.                        accumulator, then dropping all but the low order 8 
  87.                        bits of the result.
  88.  
  89.              The intent of the additional characters is to facilitate 
  90.              error checking and recovery, making the xmodem protocol an 
  91.              "error-free" means of data transfers under otherwise hostile 
  92.              conditions.
  93.  
  94.              The block number and its compliment are included to insure 
  95.              that no blocks are accidentally lost during transmission, 
  96.              and to prevent the accidental duplication of a data block 
  97.              which might be caused by spurious line noise. The checksum 
  98.              seeks to insure the validity of the actual data which might 
  99.              become garbled by line noise. The fixed length block format 
  100.              tends to simplify the logic required to implement the 
  101.              protocol in the first place.
  102.  
  103.  
  104.         2.2 THE INTER-COMPUTER DIALOG
  105.  
  106.              Xmodem is essentially uni-directional in nature. That is, 
  107.              the actual flow of meaningful information occurs in one 
  108.              direction at a time, from the sending computer to the 
  109.              receiving computer. This is not meant to imply, however, 
  110.              that only one computer sends and the computer receives. To 
  111.              the contrary, there is a constant "dialog" going on between 
  112.              the two computers during the course of the transmission. It 
  113.              is this dialog that permits xmodem to be true, "error-free" 
  114.              transfer method.
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                Copyright (c) 1987 - Information Technology, Ltd.
  128.  
  129.  
  130.  
  131.  
  132.  
  133.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  134.  
  135.  
  136.              Xmodem is a receiver-driven protocol. The receiving 
  137.              computer initiates and almost exclusively controls the 
  138.              transmissions, through a series of pre-planned responses. A 
  139.              typical, though brief dialog might look like this:
  140.  
  141.              RECEIVER SENDER MEANING
  142.  
  143.               <NAK> --------------> READY TO RECEIVE
  144.                     <------------- <BLOCK1> FIRST BLOCK SENT
  145.               <ACK> --------------> BLOCK RECEIVED OK
  146.                     <------------- <BLOCK2> SECOND BLOCK
  147.               <NAK> --------------> ERROR, RESEND
  148.                     <------------- <BLOCK2> SECOND BLOCK
  149.               <ACK> --------------> BLOCK RECEIVED OK
  150.                     <------------- <EOT> END OF FILE
  151.               <ACK> --------------> E-O-F UNDERSTOOD
  152.  
  153.              As you can see, it is through the responses to the sending 
  154.              computer that the receiver controls the link.
  155.  
  156.              Xmodem also makes provision for unusual circumstances by 
  157.              providing both timeout and cancellation mechanisms. The 
  158.              rules for timeouts, time periods which may elapse before a 
  159.              disruption in transmission occurs are as follows:
  160.  
  161.                   1. Waiting for SOH - 10 seconds, Resend last 
  162.                      acknowledgement on timeout.
  163.  
  164.                   2. Waiting for other block characters - 1 second, 
  165.                      replace expected character with some pre-defined 
  166.                      value upon timeout.
  167.  
  168.                   3. Waiting for a reply to a block - 10 seconds, Resend 
  169.                      last block upon timeout.
  170.  
  171.              The original protocol description also makes it possible for 
  172.              either the sender or receiver to cancel the transmission. 
  173.              This is of particular value when too many transmission 
  174.              errors occur, or, in rare cases, when the physical 
  175.              connection is broken. The threshold beyond which either 
  176.              side may request cancellation, although specified as 10 
  177.              attempts in the original description of the protocol, has 
  178.              become somewhat arbitrary over time. The cancellation code, 
  179.              <CAN> or 0x10, may be sent by either the sender or receiver 
  180.              in place of the <SOH> or normal acknowledgment character 
  181.              respectively.
  182.  
  183.  
  184.         2.3 ENHANCEMENTS TO XMODEM
  185.  
  186.              Over the years, several significant enhancements have been 
  187.              made to the protocol as originally defined by Ward 
  188.              Christiansen. The intent of these enhancements have 
  189.              generally been to improve upon the error-handling capability 
  190.              of the protocol, and to make the protocol more amenable to 
  191.  
  192.  
  193.                Copyright (c) 1987 - Information Technology, Ltd.
  194.  
  195.  
  196.  
  197.  
  198.  
  199.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  200.  
  201.  
  202.              some less time-efficient communications environments, 
  203.              particularly those presented by for-pay services such as 
  204.              Compuserve.
  205.  
  206.              To make the protocol more error-free, the checksum employed 
  207.              in the original design has been replaced by a 16 bit 
  208.              calculation, called a Cyclical Redundancy Check or CRC. 
  209.              Based upon a polynomial equation, the CRC method can be 
  210.              mathematically demonstrated to be sensitive to all but about 
  211.              .03 per cent of errors. This error detection rate, about 
  212.              99.97 percent accurate, is far superior to the approximately 
  213.              90 to 92 percent accuracy of the checksum approach. The 
  214.              overhead of an addtional 8 bits per message seems to make 
  215.              this enhancement well worth while.
  216.  
  217.              The second enhancement seeks to improve communication over 
  218.              packet-switched networks, like those employed by Compuserve 
  219.              and other national services. Basically this enhancement 
  220.              introduces a relaxed timeout between characters in a block, 
  221.              allowing additional time before the protocol recognizes a 
  222.              timeout condition.
  223.  
  224.              The LXM xmodem engine supports both of the enhancements 
  225.              mentioned above.
  226.            
  227.  
  228.         3.0 THE LXM ENGINE
  229.  
  230.              One of the reasons for the popularity of the xmodem protocol 
  231.              over time is the simplicity of the implementation. Given a 
  232.              reasonable communications package upon which to build, 
  233.              developing a basic implementation of xmodem is relatively 
  234.              simple, although under certain operating systems, such as 
  235.              the Unix family, the attempt of the OS to be all things to 
  236.              all people may actually become an impediment.
  237.  
  238.              The intent of the LXM engine is to 1) provide xmodem 
  239.              capability, 2) in a flexible, easy to understand package, 3) 
  240.              built upon a sound foundation, the LCOMM/TCOMM 
  241.              communications handler. Because of the manner in which the 
  242.              LXM engine was designed virtually any application can have 
  243.              access to xmodem's error-free protocol, without being 
  244.              religated to simply transferring files.
  245.  
  246.         3.1 MAJOR ENGINE COMPONENTS
  247.  
  248.              The LXM engine consists, primarily of two functions, lcxrrec 
  249.              and lcxtrec, receive a record and transmit a record 
  250.              respectively. Becuase these two functions 'understand' the 
  251.              xmodem protocol internally, they assume full responsibility 
  252.              for all of the necessary housekeeping, relying upon the host 
  253.              program for only the most basic of functions.
  254.  
  255.              The lcxrrec function receives one or more records from a 
  256.              companion system. The host program controls the checking 
  257.  
  258.  
  259.                Copyright (c) 1987 - Information Technology, Ltd.
  260.  
  261.  
  262.  
  263.  
  264.  
  265.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  266.  
  267.  
  268.              method, CRC or checksum, the timeout method, normal or 
  269.              relaxed, handles, in what ever way appropriate, blocks of 
  270.              data that have been received, and can optionally monitor the 
  271.              flow of data from the companion system. The lcxrrec assumes 
  272.              the responsibilty for synchronizing with the companion 
  273.              system and for correctly maintaining the flow of 
  274.              information.
  275.  
  276.              Lcxtrec performs in a like fashion when the host program 
  277.              wants to send one or more records. The host program has 
  278.              only to present the record to be transmited, and lcxtrec 
  279.              does the rest. The Lcxtrec module assumes responsibility 
  280.              for establishing synchronization with the receiving 
  281.              computer, and for recognizing the checking method, CRC or 
  282.              checksum, that the receiver wants to use. Lcxtrec also 
  283.              terminates the transmisssion, when told to do so by the host 
  284.              program, and permits the host to optionally monitor the data 
  285.              flow.
  286.  
  287.  
  288.         3.2 NOTES AND WARNINGS
  289.  
  290.         3.2.1 MODIFICATIONS
  291.  
  292.              The LXM engine is closely integrated with LCOMM/TCOMM. 
  293.              While there is every likelyhood that the engine can be 
  294.              modified to function with other similar packages, 
  295.              Information Technology, Ltd., can only support the LXM 
  296.              engine when used with either LCOMM or TCOMM.
  297.  
  298.  
  299.         3.2.2 PARITY AND DATA BITS
  300.  
  301.              The xmodem protocol is an 8-bit protocol. That is to say it 
  302.              neither recognizes nor tolerates parity checking, i.e. 7 
  303.              data bits plus a specified parity. Since the LXM engine 
  304.              cannot determine the current settings for parity and number 
  305.              of data bits, the responsibility for controlling these 
  306.              settings rests wit the host program. Before using either of 
  307.              the key functions lcxrrec or lcxtrec, the host program must 
  308.              insure that the settings are no parity, 8 data bits, using 
  309.              the comm_setup function. Upon final termination of the 
  310.              function, the host program must reset these values to their 
  311.              original settings, if necessary.
  312.  
  313.  
  314.         3.2.3 INTERNAL TIMER FUNCTION
  315.  
  316.              Both lcxrrec and lcxtrec employ a hardware-based timing 
  317.              function that connects directly to the normal real-time 
  318.              clock vector 0x1C; The Turbo C version of this function 
  319.              also establishes an special routine, using the atexit() 
  320.              function, to insure that this vector is re-established at is 
  321.              original setting when program termination occurs. This is 
  322.              not true of the Datalight version however. The Datalight 
  323.  
  324.  
  325.                Copyright (c) 1987 - Information Technology, Ltd.
  326.  
  327.  
  328.  
  329.  
  330.  
  331.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  332.  
  333.  
  334.              library does not, at present, have an equivalent function. 
  335.              While every effort has been made, for Datalight users, to 
  336.              insure that the vector is properly reset, this plan may be 
  337.              tharwted by abornal termination of the host program 
  338.              resulting in a subsequent system crash. The safest method 
  339.              to Datalight user's to employ would be to use the 
  340.              lc_clrclock() function before host program termination. As 
  341.              an alternate approach, Datalight users may want to 
  342.              investigate STEVE'S LIBRARY designed for Datalight C 
  343.              users's. This excellent library does have an equivalent 
  344.              function to TURBO's atexit().
  345.  
  346.  
  347.         3.2.4 BUFFER SIZE RESTRICTION
  348.  
  349.              The LCOMM/TCOMM library permits you a great deal of freedom 
  350.              in tailoring the communications handler to meet you specific 
  351.              requirements. We must caution you, however, that when you 
  352.              are using the LXM engine, the minimum buffer sizes required 
  353.              by the comm_open function are not adequate to support LXM, 
  354.              particularly when transmitting records at either low baud 
  355.              rates, or on the new generation of high-speed (above 6 MHz) 
  356.              processors.
  357.  
  358.              During the development of LXM, it was quickly discovered 
  359.              that too small a transmit buffer quickly resulted in a 
  360.              buffer overflow condition. We recommend that, when using 
  361.              the LXM engine, the transmit buffer be set at a minimum 256 
  362.              bytes to avoid the overflow condition.
  363.  
  364.  
  365.         3.2.5 XON-XOFF CONTROL
  366.  
  367.              If your host program employs the XON-XOFF functions in 
  368.              LCOMM/TCOMM, you must be sure that the automatic XON-XOFF 
  369.              handing is disabled before you attempt to transmit or 
  370.              receive records using LXM. Failure to observe this caution 
  371.              may result in a system hang, requiring that the system be 
  372.              re-booted.
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                Copyright (c) 1987 - Information Technology, Ltd.
  392.  
  393.  
  394.  
  395.  
  396.  
  397.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  398.  
  399.  
  400.         3.3 USER-ACCESSABLE DATA
  401.  
  402.              Within LXM, certain variables have been defined as being 
  403.              globally available. The host program may examine the 
  404.              contents of these variables at any time to determine the 
  405.              current state of the LXM engine. The correct definitions of 
  406.              these variable is contained in litexm.h. Except as noted 
  407.              below, the host program must NOT alter the contents of these 
  408.              variables.
  409.  
  410.              _abort_flag - This is the only variable of the group that 
  411.                   may be altered by the host program. The flag is 
  412.                   checked periodically by the engine functions. If 
  413.                   _abort_flag has a value of 1, the function in progress 
  414.                   will be cancelled automatically by sending a CAN 
  415.                   instruction to the companion system. See the SCE.C 
  416.                   sample program for an example of how this flag may be 
  417.                   set.
  418.  
  419.              crc - If this variable has a non-zero value, then the LXM 
  420.                   engine is currently using the CRC error-checking 
  421.                   method. A zero value indicates that the original 
  422.                   checksum method is being used.
  423.  
  424.              checksum -
  425.              crcaccum - These variables hold the current/last calculated 
  426.                   check value. In a practical sense, they are of no 
  427.                   value to the host program.
  428.  
  429.              rec - This variable contains the current record (block) 
  430.                   number being processed. In the event of an 
  431.                   uncorrectable error, rec would contain the number of 
  432.                   the expected block. In the case of a successful 
  433.                   transmission or reception, rec-1 is the number of the 
  434.                   block sent or received. The value contained in this 
  435.                   variable, reduced modulo 256, provides the block number 
  436.                   required by the xmodem protocol and must NEVER be 
  437.                   disturbed.
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.                Copyright (c) 1987 - Information Technology, Ltd.
  458.  
  459.  
  460.  
  461.  
  462.  
  463.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  464.  
  465.  
  466.         4.0 ENGINE-RELATED FUNCTIONS
  467.  
  468.         FUNCTION lcxrrec
  469.  
  470.         SUMMARY
  471.  
  472.         #include <litexm.h>
  473.         #include <litecomm.h>
  474.  
  475.         int lcxrrec(port, buff, hmode, hdshk)
  476.  
  477.              unsigned port;
  478.              unsigned char *buff;
  479.              int hmode;
  480.              unsigned char *hdshk;
  481.  
  482.         DESCRIPTION
  483.  
  484.              Receive a 128 byte record from the companion system, using 
  485.              the checking method specified in hdshk, and the timeout 
  486.              value specified in hmode. If necessary, establish 
  487.              synchroniztion with the companion system.
  488.  
  489.              The port parameter is the same as used throughout the 
  490.              LCOMM/TCOMM library.
  491.  
  492.              Buff should be a pointer to a 128 byte record. All record 
  493.              characters are received into this area, and, if the area is 
  494.              too small, LXM will overwrite adjacent data without warning.
  495.  
  496.              The value of hmode determines whether normal or relaxed 
  497.              timeout values are used. Please use the constants provided 
  498.              in the litexm header file to insure a proper setting.
  499.  
  500.              The value contained initially in hdshk should be either CRC 
  501.              or NAK, defined in litexm.h. The former specifies the use 
  502.              of the 16 bit CRC checking mode, while the latter specifies 
  503.              the use of the original checksum method.
  504.  
  505.              Note that hdshk is a pointer to a character. Lcxrrec uses 
  506.              this area to store its reply to the last received block. 
  507.              Once you have set this value, and have started to receive, 
  508.              DO NOT alter its value under any circumstances. Doing so 
  509.              may cause unpredictable results.
  510.  
  511.  
  512.         EXAMPLE
  513.  
  514.              See the accompanying program SCE for an example of lcxrrec 
  515.              usage.
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.                Copyright (c) 1987 - Information Technology, Ltd.
  524.  
  525.  
  526.  
  527.  
  528.  
  529.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  530.  
  531.  
  532.         RETURN VALUES
  533.  
  534.              Lcxrrec may return several values, as defined in the 
  535.              litexm.h file. Each return value should cause the host 
  536.              program to respond in specific ways.
  537.  
  538.                   SUCCESS - A record has been successfully received into 
  539.                        the buff area. Host program process the record 
  540.                        and calls lcxrrec again.
  541.  
  542.                   RETRIES - The maximum number of attempts to receive a 
  543.                        single record has been exceeded. Lcxrrec 
  544.                        automatically cancels the session. Host program 
  545.                        should handle in an appropriate manner, e.g. issue 
  546.                        an error message.
  547.  
  548.                   ERR (-1) - Lcxrrec has detected that the host program 
  549.                        has requested cancellation of transmissions 
  550.                        through the _abort_flag setting (see below) or a 
  551.                        fatal record sequence has occurred, e.g. a block 
  552.                        number has been skipped. Lcxrrec automatically 
  553.                        cancels the session.
  554.  
  555.                   CAN - The sending program has requested cancellation. 
  556.                        Host program should handle in a fashion similar to 
  557.                        RETRIES.
  558.  
  559.                   EOT - The sending program has no more data to transmit. 
  560.                        Lcxrrec acknowledges the EOT message 
  561.                        automatically. Host program handles like an end-
  562.                        of-file condition.
  563.  
  564.                   TOUT - Lcxrrec failed to establish synchronization with 
  565.                        the sending program while waiting to receive the 
  566.                        SOH character at the start of the block. The 
  567.                        session is automatically cancelled.
  568.  
  569.                   DUPSEQ - The block just received is a duplicate of the 
  570.                        preceeding block. The host program should ignore 
  571.                        the data contained within the block, the call 
  572.                        lcxrrec to proceed with data transfer.
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                Copyright (c) 1987 - Information Technology, Ltd.
  590.  
  591.  
  592.  
  593.  
  594.  
  595.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  596.  
  597.  
  598.         FUNCTION lcxtrec
  599.  
  600.         SUMMARY
  601.  
  602.         #include <litexm.h>
  603.         #include <litecomm.h>
  604.  
  605.         int lcxtrec(port, buff)
  606.  
  607.              unsigned port;
  608.              unsigned char *buff;
  609.  
  610.         DESCRIPTION
  611.  
  612.              Transmit a 128 byte record to the companion system. The 
  613.              checking protocol, CRC or checksum, is detected 
  614.              automatically when the receiving station issues its initial 
  615.              handshaking sequence. If necessary, establish 
  616.              synchroniztion with the companion system before 
  617.              transmitting.
  618.  
  619.              The port parameter is the same as used throughout the 
  620.              LCOMM/TCOMM library.
  621.  
  622.              Buff should be a pointer to a 128 byte record to be sent to 
  623.              the companion system. This is not a typical, null-terminated 
  624.              string as usually found in C. All 128 bytes, starting at 
  625.              the pointer will be transmitted. It is the responsibility 
  626.              of the host program to provide any padding that might be 
  627.              required to satisfy the 128 byte requirement.
  628.  
  629.  
  630.         EXAMPLE
  631.  
  632.              See the accompanying program SCE for an example of lcxtrec 
  633.              usage.
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                Copyright (c) 1987 - Information Technology, Ltd.
  656.  
  657.  
  658.  
  659.  
  660.  
  661.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  662.  
  663.  
  664.         RETURN VALUES
  665.  
  666.              Lcxtrec may return several values, as defined in the 
  667.              litexm.h file. Each return value should cause the host 
  668.              program to respond in specific ways.
  669.  
  670.                   SUCCESS - The record has been successfully sent from 
  671.                        the buff area. Host program either calls lcxtrec 
  672.                        with the next record to transmit, or lcxteot to 
  673.                        indicate End of Transmisson to the companion 
  674.                        system. 
  675.  
  676.                   RETRIES - The maximum number of attempts to send a 
  677.                        single record has been exceeded. Lcxtrec 
  678.                        automatically cancels the session. Host program 
  679.                        should handle in an appropriate manner, e.g. issue 
  680.                        an error message.
  681.  
  682.                   ERR (-1) - Lcxtrec has detected that the host program 
  683.                        has requested cancellation of transmissions 
  684.                        through the _abort_flag setting (see below).
  685.  
  686.                   CAN - The receiving program has requested cancellation. 
  687.                        Host program should handle in a fashion similar to 
  688.                        RETRIES.
  689.  
  690.  
  691.         FUNCTION lcxteot
  692.  
  693.         SUMMARY
  694.  
  695.         #include <litexm.h>
  696.         #include <litecomm.h>
  697.  
  698.         int lcxtrec(port)
  699.  
  700.              unsigned port;
  701.  
  702.         DESCRIPTION
  703.  
  704.              Send and End of Transmission (End of File) to the receiving 
  705.              system. This function must be called to successfully close 
  706.              out the transmission session.
  707.  
  708.         EXAMPLE
  709.  
  710.              See the accompanying program SCE for an example of lcxtrec 
  711.              usage.
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                Copyright (c) 1987 - Information Technology, Ltd.
  722.  
  723.  
  724.  
  725.  
  726.  
  727.                       LXM - XMODEM ENGINE FOR LCOMM/TCOMM
  728.  
  729.  
  730.         RETURN VALUES
  731.  
  732.              Lcxteot returns one of two values, as defined in the 
  733.              litexm.h file. 
  734.  
  735.                   SUCCESS - The receiving station has correctly 
  736.                        acknowledged the EOT. The host program terminates 
  737.                        transmission mode normally.
  738.  
  739.                   CAN - Either the receiving system has responded to the 
  740.                        EOT message with a CAN code, or has failed to 
  741.                        respond correctly and the lcxteot function has 
  742.                        sent the CAN code to the receiving system. Host 
  743.                        program should handle in an appropriate manner, 
  744.                        e.g. issue an appropriate error message.
  745.  
  746.              Regardless of the value returned, invoking lcxteot always 
  747.              terminates the current transmission session.
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.                Copyright (c) 1987 - Information Technology, Ltd.
  788.  
  789.  
  790.  
  791.  
  792.  
  793.